from django.db import models

# Create your models here.
class Teacher(models.Model):
    '''
        老师模型类
    '''
    name = models.CharField('老师' , max_length=50)

    class Meta:
        db_table = 'teacher'


class Wife(models.Model):
    """
    老师的妻子模型
    """
    name = models.CharField("妻子" , max_length=50)
    teacher = models.OneToOneField(Teacher , on_delete = models.CASCADE)#增加一对一属性
    class Meta:
        db_table = 'wife'